home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Draw
/
CCE_Particle.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
2KB
|
85 lines
package Local.Draw
{
import flash.display.Graphics;
import flash.geom.Point;
public class CCE_Particle
{
public static var mAllocateID:int = 0;
public static const zPoint:Point = new Point(0,0);
public var mNext:CCE_Particle;
public var mDelay:int;
public var mID:String;
public var mDelta:Point;
public var mDecay:Number = 0.98;
public var mAlpha:Number;
public var mPosition:Point;
public function CCE_Particle(param1:Point, param2:Point)
{
mDecay = 0.98;
super();
mID = "p" + ++mAllocateID;
mPosition = param1;
mDelta = param2;
mDecay = 0.95;
§§push(§§findproperty(mDelay));
§§push(Math.random() * 5);
if(true)
{
§§push(§§pop() + 5);
}
§§pop().mDelay = §§pop();
mAlpha = 1;
}
public function Render(param1:Graphics) : void
{
param1.beginFill(16777215,mAlpha);
param1.drawCircle(mPosition.x,mPosition.y,mDelta.length);
}
public function DrawLine(param1:Graphics, param2:Point, param3:Point) : void
{
param1.moveTo(param2.x,param2.y);
param1.lineTo(param3.x,param3.y);
}
public function DrawPoint(param1:Graphics, param2:Point) : void
{
var _loc3_:Number = NaN;
_loc3_ = 2;
param1.moveTo(param2.x - _loc3_,param2.y - _loc3_);
param1.lineTo(param2.x + _loc3_,param2.y + _loc3_);
param1.moveTo(param2.x + _loc3_,param2.y - _loc3_);
param1.lineTo(param2.x - _loc3_,param2.y + _loc3_);
}
public function Process() : Boolean
{
mPosition.x += mDelta.x;
mPosition.y += mDelta.y;
mDelta.x *= mDecay;
mDelta.y *= mDecay;
§§push(§§findproperty(mAlpha));
§§push(mAlpha);
if(true)
{
§§push(§§pop() * mDecay);
}
§§pop().mAlpha = §§pop();
return mAlpha >= 0.2;
}
}
}